<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>批量打开网址</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

</head>
<script type="text/javascript">
	function keySend(event) {
		if (event.ctrlKey && event.keyCode == 13) {
			sub();
		}
	}

	function sub() {
		var urlStr = document.getElementById("httpIds").value;
		// 		alert(urlStr);
		var amount = 0;
		var urls = urlStr.split("\n");
		// 		alert(urls.length);
		for (var i = 0; i < urls.length; i++) {
			var url = urls[i];
			if (url.indexOf('http') != -1) {
				amount = amount + 1;
				//var newTab = window.open('about:blank');
				//newTab.location.href = url;
// 				window.open(url,"_blank");
				newWindow(url);
			}
		}
		if (amount == 0) {
			alert("请检查是否包含有效的URL！");
		}
	}
	function newWindow(url) { 
	  var a = document.createElement('a'); 
	  a.setAttribute('href', url); 
	  a.setAttribute('target', '_blank');
	  document.body.appendChild(a);
	  a.click(); 
	}
</script>
<body align="center" onkeydown="keySend(event)">
<!-- http://www.openurls.com.cn/ -->
	<p>HTTP地址列表<按Ctrl+Enter直接发送>
	<p>
		<textarea id="httpIds" rows="20" cols="140"></textarea>
	<p>
		<input type="button" value="打  开" onclick="sub()" style="width:124px;height:37px;font-size:20px" />
		&nbsp;&nbsp;
		<input type="button" value="清  除" onclick="document.getElementById('httpIds').value=''"  style="width:124px;height:37px;font-size:20px"/>
</body>
</html>
